## @package Interfaces  
# Darryl Wallace - 2010 darryl@wallynet.ca or wallacdj@gmail.com 

from PyQt4.QtCore import QPoint, QString, QRect, QStringList
from PyQt4.QtGui import QImage, QPainter, QWidget, QPainterPath, QUndoCommand

## These classes may use:
#QImage
#QPainter
#QWidget
#QPainterPath
#QPoint
#QRect
#QString
#QStringList

class BrushCommand(QUndoCommand):
    
    def __init__(self, device, pen, brushName, imageList, posList, parent=None):
        QUndoCommand.__init__(self, parent)
        self.device=device
        self.pen=pen
        self.brushName=brushName
        self.imageList=imageList
        self.posList=posList
        self.setTitle(brushName)
    def undo(self):
        pass
    def redo(self):
        pass
#        painter=QtGui.QPainter(self.device)
#        painter.setPen(pen)
#        brushInterface=BrushInterface()
#        for oldPos, newPos in self.posList:
        
        
#BrushCommand

class BrushInterface:

    ## # Virtual!: Return a list of brushes
    # @return Python list of brush names
    def brushes(self):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #brushes
    
    ## VIRTUAL: Mouse Press function
    # @param brush QString brush name.
    # @param painter QPainter object
    # @param pos QPoint object
    # @param QRect object indicating area where painting occured.
    def mousePress(self, brush, painter, pos):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #mousePress
    
    ## VIRTUAL: Mouse Move function
    # @param brush QString brush name.
    # @param painter QPainter object
    # @param pos QPoint object
    # @param QRect object indicating area where painting occured.
    def mouseMove(self, brush, painter, oldPos, newPos):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #mouseMove
    
    ## VIRTUAL: Mouse Release function
    # @param brush QString brush name.
    # @param painter QPainter object
    # @param pos QPoint object
    # @param QRect object indicating area where painting occured.
    def mouseRelease(self, brush, painter, pos):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #mouseRelease
    
#BrushInterface

## Shape interface
class ShapeInterface:
    
    ## VIRTUAL: Returns string list of available shapes
    # @return string list of shapes
    def shapes(self):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #shapes
    
    ##VIRTUAL: Create the shapes
    # @param shape String name of the shape
    # @param parent QWidget parent.
    # @return painterPath
    def generateShape(self, shape, parent):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #generateShape
#ShapeInterface

## Filter interface
class FilterInterface:
    
    ## VIRTUAL: Returns the list of available filters
    # @return string list of shapes
    def filters(self):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #filters
    
    ## VIRTUAL: Runes the filter image
    # @param filter String filter name
    # @param image the QImage that is to have the filter applied
    # @param parent The QWidget object that is the parent
    def filterImage(self, filter, image, parent):
        raise NotImplementedError, "This is a pure virtual method.  It requires implementation in a subclass."
    #filterImage
#FilterInterface
    
if __name__=="__main__":
    print "THIS FILE DEFINES THE INTERFACES CLASSES."
